var menua=officeTwo.getElementsByTagName('a');
for(var i=1;i<menua.length;i++){
	EventUtil.addHandler(menua[i],"click",function(event){
    var _event=EventUtil.getEvent(event);
    var target=EventUtil.getTarget(_event);
    for(var j=1;j<menua.length;j++){
    	menua[j].style.color="black";
    }
    target.style.color="rgba(65,45,200,.7)";
	});
}
// 导航的选择
var nava=document.getElementsByClassName('office_nav')[0].getElementsByTagName('a');
var navdivs=document.getElementsByClassName('office_article')[0].getElementsByTagName('div');
var arrows=[false,false,false,false];
for(var i=0;i<nava.length;i++){
	EventUtil.addHandler(nava[i],"click",function(event){
		var _event=EventUtil.getEvent(event);
		var target=EventUtil.getTarget(_event);
		target=target.getElementsByTagName("p")[0]?target.getElementsByTagName("p")[0]:target;
		for(var j=0;j<4;j++){
			nava[j].getElementsByTagName("p")[0].classList.add("arrowback");
			target.classList.remove("arrowturn");
			navdivs[j].classList.remove("shownavdiv");
			navdivs[j].classList.add("hidenavdiv");
		}
		if(!arrows[parseInt(target.getAttribute("data-order"))]){
			target.classList.remove("arrowback")
		    target.classList.add("arrowturn");
		    navdivs[parseInt(target.getAttribute("data-order"))].classList.remove("hidenavdiv");
		    navdivs[parseInt(target.getAttribute("data-order"))].classList.add("shownavdiv");
		    for(var j=0;j<4;j++){
		    	arrows[j]=false;
		     }
		    arrows[parseInt(target.getAttribute("data-order"))]=true;
		}else{
			target.classList.remove("arrowturn")
		    target.classList.add("arrowback");
		    navdivs[parseInt(target.getAttribute("data-order"))].classList.remove("shownavdiv");
		    navdivs[parseInt(target.getAttribute("data-order"))].classList.add("hidenavdiv");
		    arrows[parseInt(target.getAttribute("data-order"))]=false;
		}	
	});
}
// 导航菜单下的类型切换
var sectionos=document.getElementsByClassName("office_article")[0].getElementsByTagName("div")[0].getElementsByTagName("section");
var as=sectionos[0].getElementsByTagName('a');
for(var i=0;i<as.length;i++){
	EventUtil.addHandler(as[i],"click",function(event){
		var _event=EventUtil.getEvent(event);
		var target=EventUtil.getTarget(_event);
		for(var j=1;j<as.length;j++){
			as[j].classList.remove("backcolor");
			console.log(sectionos[j+1]);
			sectionos[j].classList.remove("showsection");
			sectionos[j].classList.add("hidesection");
		}
		target.classList.add("backcolor");
		sectionos[parseInt(target.getAttribute("data-order"))].classList.add("showsection");
		sectionos[parseInt(target.getAttribute("data-order"))].classList.remove("hidesection");

	});
}


// 导航菜单下的类型切换
var sections=document.getElementsByClassName("office_article")[0].getElementsByTagName("div")[3].getElementsByTagName("section");
var ps=sections[0].getElementsByTagName('a');
for(var i=0;i<ps.length;i++){
	EventUtil.addHandler(ps[i],"click",function(event){
		var _event=EventUtil.getEvent(event);
		var target=EventUtil.getTarget(_event);
		for(var j=0;j<ps.length;j++){
			ps[j].classList.remove("backcolor");
			sections[j+1].classList.remove("showsection");
			sections[j+1].classList.add("hidesection");
		}
		target.classList.add("backcolor");
		sections[parseInt(target.getAttribute("data-order"))].classList.add("showsection");
		sections[parseInt(target.getAttribute("data-order"))].classList.remove("hidesection");

	});
}


